//
//  MyCollectionViewCell.m
//  22-QQMusic
//
//  Created by Snow on 16/8/13.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "MyCollectionViewCell.h"
#define kWidth self.contentView.frame.size.width
#define kHeight self.contentView.frame.size.height

@interface MyCollectionViewCell ()
@end
@implementation MyCollectionViewCell
- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _labelOfTitle = [[UILabel alloc] init];
        _labelOfContent = [[UILabel alloc] init];
        _image = [[UIImageView alloc] init];
        [self.contentView addSubview:_labelOfTitle];
        [self.contentView addSubview:_labelOfContent];
        [self.contentView addSubview:_image];
    }
    return self;
}

- (void)applyLayoutAttributes:(UICollectionViewLayoutAttributes *)layoutAttributes
{
    [super applyLayoutAttributes:layoutAttributes];
    _image.frame = CGRectMake(0, 0, kWidth,kHeight / 4 * 3);
    _labelOfTitle.frame = CGRectMake(0, kHeight / 4 * 3, kWidth, kHeight / 8);
    _labelOfContent.frame = CGRectMake(0, kHeight / 8 * 7, kWidth, kHeight / 8);
    _labelOfContent.font = [UIFont systemFontOfSize:12];
}

@end
